﻿using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MYSQL学习.Migrations
{
    public partial class init : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterDatabase()
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "fa_order",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    User_id = table.Column<int>(type: "int", nullable: false, defaultValue: 0, comment: "用户ID"),
                    Order_no = table.Column<string>(type: "longtext", nullable: false, comment: "订单号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    State = table.Column<string>(type: "enum('0','1','2','3')", nullable: false, comment: "订单状态")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    Createtime = table.Column<int>(type: "int", nullable: false, defaultValue: 0, comment: "创建时间"),
                    Updatetime = table.Column<int>(type: "int", nullable: false, defaultValue: 0, comment: "更新时间"),
                    Paytime = table.Column<int>(type: "int", nullable: false, defaultValue: 0, comment: "支付时间"),
                    Peisongtime = table.Column<int>(type: "int", nullable: false, defaultValue: 0, comment: "接单时间")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_fa_order", x => x.Id);
                },
                comment: "是否删除")
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "fa_order");
        }
    }
}
